package com.sayonaragutgut.android.activities;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;

import com.sayonaragutgut.android.core.PesquisadorApinfo;

public class PesquisarVagasActivity extends Activity {
	Button btnPesquisarVagas = null;
	ProgressBar progressBarPesquisandoVagas = null;
	
	private final View.OnClickListener btnPesquisarClickListener = new View.OnClickListener() {
		@Override
		public void onClick(View v) {
			progressBarPesquisandoVagas.setIndeterminate(true);
			progressBarPesquisandoVagas.setVisibility(View.VISIBLE);
		}
	};
	
	private final PesquisadorApinfo.PesquisaConcluidaListener pesquisaConcluidaListener = 
			new PesquisadorApinfo.PesquisaConcluidaListener() {
		@Override
		public void onPesquisaConcluida(int result) {
			processarRetornoPesquisaApinfo();
		}
	};
	
	private final void processarRetornoPesquisaApinfo() {
		progressBarPesquisandoVagas.setVisibility(View.INVISIBLE);
	}
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.pesquisar_vagas);
		
		btnPesquisarVagas = (Button) findViewById(R.id.btnPesquisarVagas);
		btnPesquisarVagas.setOnClickListener(btnPesquisarClickListener);
		
		progressBarPesquisandoVagas = (ProgressBar) findViewById(R.id.progressBarPesquisandoVagas);
		progressBarPesquisandoVagas.setVisibility(View.INVISIBLE);
	}
	
}
